﻿<BaseControl:DataControl x:Class="jSLApp.Client.Forms.StartPage"                         
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                         xmlns:BaseControl="clr-namespace:jSLCore.Client.Presentation.BaseControl;assembly=jSLCore.Client.Presentation" 
                         xmlns:rad="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
                         xmlns:j="clr-namespace:jSLCore.Client.Presentation.Controls;assembly=jSLCore.Client.Presentation" 
                         xmlns:radc="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
                         xmlns:BaseConverters="clr-namespace:jSLCore.Client.Presentation.jBinding.BaseConverters;assembly=jSLCore.Client.Presentation" 
                         xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" 
                         xmlns:Security="clr-namespace:jSLApp.Client.Security" 
                         xmlns:telerikTransitions="clr-namespace:Telerik.Windows.Controls.TransitionEffects;assembly=Telerik.Windows.Controls" xmlns:jBinding="clr-namespace:jSLCore.Client.Presentation.jBinding;assembly=jSLCore.Client.Presentation" mc:Ignorable="d"
    d:DesignHeight="1300" d:DesignWidth="400" Foreground="{StaticResource absoluteWhite}">
	<BaseControl:DataControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="../Resources/Common.xaml"/>
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</BaseControl:DataControl.Resources>    
	<BaseControl:DataControl.Content>
        <Grid>
        	<Grid.RowDefinitions>
        		<RowDefinition Height="2*"/>     	
				<RowDefinition Height="auto"/>
			</Grid.RowDefinitions>      			     
        <j:ImageGroupBox Grid.Row="1" Margin="0">
                <j:ImageGroupBox.Header>
                    <TextBlock Text="Рекомендации" FontSize="16" Margin="40,0,0,0"/>
                </j:ImageGroupBox.Header>
                <radc:RadCoverFlow x:Name="favoriteFilms" CameraViewpoint="Bottom" OffsetY="60" SelectionMode="Single" SelectionChanged="selFilm_Changed" Height="158" CameraDistance="360" DistanceBetweenItems="50">
                    <radc:RadCoverFlow.ItemTemplate>
                        <DataTemplate>                            
                                <Grid Width="85" Height="118">                                
                                    <Border BorderBrush="{StaticResource absoluteBlack}" BorderThickness="1" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Center" MinWidth="64" MinHeight="54">
                                		    <Border BorderBrush="{StaticResource absoluteWhite}" BorderThickness="4" Margin="0" d:LayoutOverrides="Width, Height">
                                			    <Grid>
                                			    <Image Stretch="Uniform">
                                				    <Image.Source>
                                                        <Binding Path="SmallCover">
                                						    <Binding.Converter>
                                							    <BaseConverters:jImageSourceConverter/>
                                						    </Binding.Converter>
                                					    </Binding>
                                				    </Image.Source>
                                			    </Image>
											    <Image Source="/jSLApp.Client;component/Resources/SelectedFilm.png" Margin="0" Width="32" Height="32" HorizontalAlignment="Left" VerticalAlignment="Top">
                                			    <Image.Visibility>
                                				    <Binding Path="IsSelected">
                                					    <Binding.Converter>
                                						    <BaseConverters:jBoolToVisibilityConverter/>
                                					    </Binding.Converter>
                                				    </Binding>
                                			    </Image.Visibility>
                                			    <Image.RenderTransform>
													    <CompositeTransform TranslateY="-20" TranslateX="-17"/>
										        </Image.RenderTransform>
                                		    </Image>										                                	
											    </Grid>
                                		    </Border>                                		
                                    </Border>
                                </Grid>                            
                        </DataTemplate>
                    </radc:RadCoverFlow.ItemTemplate>
                </radc:RadCoverFlow>
            </j:ImageGroupBox>
        <Grid Grid.Row="0">
                <rad:RadBusyIndicator x:Name="posterLoading">
                    <rad:RadTransitionControl x:Name="filmPoster">
                        <rad:RadTransitionControl.Transition>
                            <telerikTransitions:SlideAndZoomTransition MinAlpha="0.1"
                                                   MinZoom="0.9"
                                                   SlideDirection="LeftToRight"
                                                   StartSlideAt="0.25" />
                        </rad:RadTransitionControl.Transition>
                        <rad:RadTransitionControl.ContentTemplate>
                            <DataTemplate>
                                <Image  Stretch="UniformToFill" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding}"/>
                            </DataTemplate>
                        </rad:RadTransitionControl.ContentTemplate>
                    </rad:RadTransitionControl>
                </rad:RadBusyIndicator>
                <rad:RadTransitionControl x:Name="selFilm">
                    <rad:RadTransitionControl.Transition>
                        <telerikTransitions:FadeTransition />
                    </rad:RadTransitionControl.Transition>
                    <rad:RadTransitionControl.ContentTemplate>
                        <DataTemplate>
                            <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="9*"/>
                    </Grid.ColumnDefinitions>
				    <Grid.RowDefinitions>
				    	<RowDefinition/>   
						<RowDefinition Height="auto" MinHeight="150"/>
					</Grid.RowDefinitions>
                                <Border Grid.Column="0" Grid.Row="1" Background="{StaticResource GlassBrush}" MinHeight="30" BorderThickness="0,1,0,0" BorderBrush="{StaticResource absoluteBlack}" >
                                    <Border HorizontalAlignment="Left" Width="30" Background="{StaticResource orangeBorder}" Cursor="Hand" MouseLeftButtonDown="goPrev_Clicked">
                                            <Path Stretch="Fill" Width="10" Height="10" Fill="{StaticResource backGround22}" Data="F1 M 15.7427,9.08804L 7.87341,13.6307L 0,18.1773L 0.00134277,9.08804L 0.00134277,3.05176e-005L 7.87341,4.54535L 15.7427,9.08804 Z " RenderTransformOrigin="0.5,0">
                                            	<Path.RenderTransform>
                                                    <ScaleTransform ScaleX="-1" ScaleY="1"/>
                                                </Path.RenderTransform>                                 
											</Path>
                                    </Border>
                                </Border>
                                <Border Grid.Column="1" Grid.Row="1" Background="{StaticResource GlassBrush}" BorderBrush="{StaticResource absoluteBlack}" BorderThickness="0,1,0,0">
                                    <Border HorizontalAlignment="Right" Width="30" Background="{StaticResource orangeBorder}" Cursor="Hand" MouseLeftButtonDown="goNext_Clicked">
                                            <Path Stretch="Fill" Width="10" Height="10" Fill="{StaticResource backGround22}" Data="F1 M 15.7427,9.08804L 7.87341,13.6307L 0,18.1773L 0.00134277,9.08804L 0.00134277,3.05176e-005L 7.87341,4.54535L 15.7427,9.08804 Z " />                                        
                                    </Border>
                                </Border>
                                <Grid Grid.Column="1" Grid.Row="1">
						        <Grid.ColumnDefinitions>
							        <ColumnDefinition Width="4*"/>
							        <ColumnDefinition Width="*"/>
						        </Grid.ColumnDefinitions>
                                    <StackPanel Orientation="Vertical" Grid.Column="0" Margin="5">
                                        <TextBlock Text="{Binding Name}" FontSize="26" FontWeight="Bold" Foreground="{StaticResource absoluteWhite}" MouseLeftButtonDown="goSelFilm_Clicked" Cursor="Hand"/>
                                        <TextBlock Text="{Binding Description}" TextWrapping="Wrap" FontSize="14" Foreground="{StaticResource absoluteWhite}" MouseLeftButtonDown="goSelFilm_Clicked" Cursor="Hand"/>
						            </StackPanel>
					            </Grid>	
					<Border Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,20,0,20" Background="{StaticResource GlassBrush}" Cursor="Hand" MouseLeftButtonDown="selFilmPanel_Clicked">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition/>
								<ColumnDefinition/>
							</Grid.ColumnDefinitions>
                                        <Border BorderBrush="{StaticResource absoluteBlack}" BorderThickness="1" Grid.Column="0" VerticalAlignment="Center" Margin="0" >
                                            <Border BorderBrush="{StaticResource absoluteWhite}" BorderThickness="4" Margin="0">
                                                <Grid>
                                                    <Image Stretch="Uniform" >
                                                        <Image.Source>
                                                            <Binding Path="SmallCover">
                                                                <Binding.Converter>
                                                                    <BaseConverters:jImageSourceConverter/>
                                                                </Binding.Converter>
                                                            </Binding>
                                                        </Image.Source>
                                                    </Image>
                                                    <Image Stretch="Uniform" >
                                                        <Image.Source>
                                                            <Binding Path="BigImage">
                                                                <Binding.Converter>
                                                                    <BaseConverters:jImageSourceConverter/>
                                                                </Binding.Converter>
                                                            </Binding>
                                                        </Image.Source>
                                                    </Image>
                                                </Grid>                                                
                                            </Border>
                                        </Border>
                                        <UserControl Grid.Column="1" MinWidth="250">
                                            <rad:RadDockPanel LastChildFill="True" Margin="15">
											<StackPanel Orientation="Vertical" rad:RadDockPanel.Dock="Bottom">
                                                <Button Content="Смотреть..." Click="goSelFilm_Clicked" Width="100" HorizontalAlignment="Right" Margin="0"/>
                                                    <Button Content="Выбрать" Click="provideSelectedFilm_Clicked" Width="100" HorizontalAlignment="Right" Margin="0">
                                                <BaseControl:BaseControl.jBinding>
                                                    <Security:SecurityBinding Permission="SetSelectedFilm"/>
                                                </BaseControl:BaseControl.jBinding>
                                            </Button>
											</StackPanel>
                                            <StackPanel Orientation="Vertical" Grid.Column="1">
                                            <Controls:RadRating Value="{Binding Rating}" IsReadOnly="True" HorizontalAlignment="Left">
                                            	<Controls:RadRating.ItemTemplate>
                                            		<DataTemplate>
                                            			<TextBlock Text="{Binding}"/>
													</DataTemplate>                                	
												</Controls:RadRating.ItemTemplate>
                                            </Controls:RadRating>

                                                    <j:LeftHeaderContainer FontSize="16">
                                                        <j:LeftHeaderContainer.Header>
                                                            <TextBlock Text="Жанр:" FontSize="18" FontWeight="Bold"/>
                                                        </j:LeftHeaderContainer.Header>
                                                        <TextBlock Text="{Binding GenreName}" Margin="5"/>
                                                    </j:LeftHeaderContainer>

                                                    <j:LeftHeaderContainer FontSize="16">
                                            	<j:LeftHeaderContainer.Header>
                                                        <TextBlock Text="Год:" FontSize="18" FontWeight="Bold"/>
                                                </j:LeftHeaderContainer.Header>
                                            	<TextBlock Text="{Binding Year}" Margin="5"/>
                                            </j:LeftHeaderContainer>

                                                <j:LeftHeaderContainer FontSize="16">
                                                        <j:LeftHeaderContainer.Header>
                                                            <TextBlock Text="Страна:" FontSize="18" FontWeight="Bold"/>
                                                        </j:LeftHeaderContainer.Header>
                                                        <TextBlock Text="{Binding Country}" Margin="5"/>                                                        
                                                    </j:LeftHeaderContainer>
                                                
                                                    

                                                    <StackPanel Orientation="Horizontal" Margin="0,5,0,0">                                                        
                                                        <Image Source="../Resources/18Icon.png" ToolTipService.ToolTip="Содержимое может содержать сцены насилия или сцены эротики. Не рекомендуется к просмотру лицами, не достигшими 18-ти лет, а так же людям со слабой психикой." Stretch="Uniform" Width="32" Height="32">
                                                            <Image.Visibility>
                                                                <jBinding:jBinding Path="AgeNeed" >
                                                                    <jBinding:jBinding.Converter>
                                                                        <BaseConverters:jBoolToVisibilityConverter/>
                                                                    </jBinding:jBinding.Converter>
                                                                </jBinding:jBinding>
                                                            </Image.Visibility>
                                                        </Image>
                                                        <Image  Source="../Resources/SmoothStreaming.png" ToolTipService.ToolTip="Smooth Streaming источник. Видео может быть просмотрено в High Quality или High Depth режимах при наличии быстрого интернет соединения" Stretch="Uniform" Width="32" Height="32" HorizontalAlignment="Left" Margin="5,-5,0,0">
                                                            <Image.Visibility>
                                                                <jBinding:jBinding Path="IsSmoothStreaming" >
                                                                    <jBinding:jBinding.Converter>
                                                                        <BaseConverters:jBoolToVisibilityConverter/>
                                                                    </jBinding:jBinding.Converter>
                                                                </jBinding:jBinding>
                                                            </Image.Visibility>                                                                
                                                        </Image>
                                                    </StackPanel>
                                                </StackPanel>											
											</rad:RadDockPanel>
                                        </UserControl>
                                    </Grid>
					</Border>                   					 
                </Grid>
                        </DataTemplate>
                    </rad:RadTransitionControl.ContentTemplate>
                </rad:RadTransitionControl>
            </Grid>   			
		</Grid>                
		</BaseControl:DataControl.Content>
</BaseControl:DataControl>
